$OpenBSD: patch-SConstruct,v 1.1.1.1 2015/03/26 06:49:11 dcoppa Exp $

- Don't hardcode g++ usage
- Don't link against pthreads (XXX why was it there in the first place?)
- Use saner libraries names
- Fix library naming

--- SConstruct.orig	Sun Mar 15 14:25:04 2015
+++ SConstruct	Wed Mar 18 08:15:14 2015
@@ -119,7 +119,8 @@ elif platform == 'mingw':
     env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] )
 elif platform.startswith('linux-gcc'):
     env.Tool( 'default' )
-    env.Append( LIBS = ['pthread'], CCFLAGS = os.environ.get("CXXFLAGS", "-Wall"), LINKFLAGS=os.environ.get("LDFLAGS", "") )
+    env["CXX"] = os.environ["CXX"]
+    env.Append( CCFLAGS = os.environ.get("CXXFLAGS", "-Wall"), LINKFLAGS=os.environ.get("LDFLAGS", "") )
     env['SHARED_LIB_ENABLED'] = True
 else:
     print "UNSUPPORTED PLATFORM."
@@ -164,7 +165,7 @@ env['SRCDIST_ADD'] = SrcDistAdder( env )
 env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
                       
 env_testing = env.Clone( )
-env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] )
+env_testing.Append( LIBS = ['jsoncpp'] )
 
 def buildJSONExample( env, target_sources, target_name ):
     env = env.Clone()
@@ -187,13 +188,13 @@ def buildUnitTests( env, target_sources, target_name )
     env.AlwaysBuild( check_alias_target )
 
 def buildLibrary( env, target_sources, target_name ):
-    static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
-                                    source=target_sources )
+    static_lib = env.StaticLibrary( target=target_name, source=target_sources )
     global lib_dir
     env.Install( lib_dir, static_lib )
     if env['SHARED_LIB_ENABLED']:
-        shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
-                                        source=target_sources )
+        shared_lib = env.SharedLibrary( target=target_name,
+                                        source=target_sources,
+                                        SHLIBSUFFIX=".so.%s" % os.environ["LIBjsoncpp_VERSION"] )
         env.Install( lib_dir, shared_lib )
     env['SRCDIST_ADD']( source=[target_sources] )
 
